package com.lsk.netdisk.commons.authz.aspect;

import com.lsk.netdisk.common.redis.core.RedisComponent;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class RedisAspect {
	@Autowired
	private RedisComponent redisComponent;

	@Pointcut("@annotation(com.lsk.netdisk.commons.authz.aspect.annotations)")
	public void pointcut(){}

	@Around("pointcut()")
	public Object around(ProceedingJoinPoint pjp) throws Throwable{
		try{
			return redisComponent;
		}catch (Throwable t){
			throw t;
		}
	}

}
